\subsection{Differentials over fields}
Differentials on curves will allow us to tackle some interesting questions.
\begin{enumerate}
    \item Given \( D \in \mathrm{Div}(V) \), can we calculate (or bound) \( \ell(D) \)?
    \item (Brill--Noether theory) For what integers \( r, d \) does a curve \( V \) admit a morphism \( \varphi \colon V \to \mathbb P^r \) of degree \( d \) such that \( \Im V \) is not contained in a hyperplane?
    \item (Hurwitz problem) When does there exist a morphism \( V \to W \) of smooth projective curves?
\end{enumerate}
\begin{definition}
    Let \( K / \mathbb C \) be a field extension.
    The \emph{space of differentials}, written \( \Omega_{K/\mathbb C} \), is the quotient vector space \( \faktor{M}{N} \) where \( M \) is the \( K \)-vector space spanned by symbols \( \delta x \) where \( x \in K \), and \( N \) is the subspace of \( M \) generated by
    \[ \delta(x + y) - \delta(x) - \delta(y);\quad \delta(xy) - x\delta(y) - y\delta(x);\quad \delta(a) \]
    where \( x, y \in K, a \in \mathbb C \).
    Given \( x \in K \), we define \( \dd{x} = \delta x + N \in \Omega_{K/\mathbb C} \).
    The \emph{exterior derivative} is the \( \mathbb C \)-linear map \( \mathrm{d} \colon K \to \Omega_{K/\mathbb C} \) mapping \( x \) to \( \dd{x} \).
\end{definition}
\begin{remark}
    More generally, if \( \varphi \colon A \to B \) is a ring homomorphism, we could have defined \( \Omega_\varphi = \Omega_{B/A} \) as a \( B \)-module as above.
\end{remark}
\begin{definition}
    Let \( U \) be a \( K \)-vector space.
    A \( \mathbb C \)-linear transformation \( D \colon K \to U \) is called a \emph{derivation} if \( D(xy) = xD(y) + yD(x) \).
\end{definition}
\begin{example}
    The map \( \mathrm{d} \colon K \to \Omega_{K/\mathbb C} \) is a derivation.
    The map \( \dv{x} \colon \mathbb C(X) \to \mathbb C(X) \) is a derivation.
\end{example}
\begin{lemma}[universal property]
    Let \( U \) be a \( K \)-vector space
    A map \( D \colon K \to U \) is a derivation if and only if there is a \( K \)-linear map \( \lambda \colon \Omega_{K/\mathbb C} \to U \) such that \( \lambda(\dd{x}) = D(x) \) for all \( x \in K \).
    % https://q.uiver.app/?q=WzAsMyxbMSwwLCJLIl0sWzAsMSwiXFxPbWVnYV97Sy9cXG1hdGhiYiBDfSJdLFsxLDIsIlUiXSxbMCwxLCJkIiwyXSxbMSwyLCJcXGxhbWJkYSIsMix7InN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRhc2hlZCJ9fX1dLFswLDIsIkQiXV0=
    \[\begin{tikzcd}
        & K \\
        {\Omega_{K/\mathbb C}} \\
        & U
        \arrow["d"', from=1-2, to=2-1]
        \arrow["\lambda"', dashed, from=2-1, to=3-2]
        \arrow["D", from=1-2, to=3-2]
    \end{tikzcd}\]
\end{lemma}
The proof is very simple and omitted.
Intuitively, \( \mathrm{d} \colon K \to \Omega_{K/\mathbb C} \) is the `best possible' derivation.
\begin{remark}
    For any derivation \( D \), if \( y \in K \) and \( y \neq 0 \), \( D(x) = D\qty(y \cdot \frac{x}{y}) = yD\qty(\frac{x}{y}) + \frac{x}{y} D(y) \), giving the quotient rule.
    \[ D\qty(\frac{x}{y}) = \frac{yDx - xDy}{y^2} \]
\end{remark}
\begin{lemma}
    \begin{enumerate}
        \item Let \( f = \frac{h}{g} \in \mathbb C(X_1, \dots, X_n) \) and write \( y = f(x_1, \dots, x_n) \) for \( x_1, \dots, x_n \in K \).
        Then
        \[ \dd{y} = \sum_{i=1}^n \pdv{f}{X_i}\qty(x_1, \dots, x_n) \dd{x_i} \]
        \item If \( K = \mathbb C(x_1, \dots, x_n) \) for \( x_i \in K \), then \( \Omega_{K/\mathbb C} \) is spanned by \( \dd{x_1}, \dots, \dd{x_n} \) as a \( K \)-vector space.
    \end{enumerate}
\end{lemma}
\begin{proof}
    Part (i) follows from the rules of calculus for \( \dd{(xy)} \), \( \dd{\qty(\frac{x}{y})} \) and \( \mathbb C \)-linearity.
    Part (ii) is immediate from part (i).
\end{proof}
We have obtained divisors in two different ways: from rational functions, and from hyperplane sections of \( V \to \mathbb P^r \).
We will do the reverse, we will first construct divisors, and then use them to build maps \( V \to \mathbb P^r \).
Differentials are another way to construct divisors.

From now, we will write \( \Omega_K \) for \( \Omega_{K/\mathbb C} \).
\begin{theorem}
    Let \( K/\mathbb C(t) \) be finite, with \( t \) transcendental over \( \mathbb C \).
    Then \( \Omega_K \) is one-dimensional as a \( K \)-vector space, and is spanned by \( \dd{t} \).
\end{theorem}
\begin{proof}
    First, suppose \( K = \mathbb C(t) \), the function field of \( \mathbb P^1 \).
    By the lemma above, \( \Omega_K \) is spanned by \( \dd{t} \).
    We need to show that \( \Omega_K \) is nonzero, then it is clearly one-dimensional.
    By the universal property, it suffices to exhibit a single nonzero derivation on \( K \).
    The function \( \dv{t} \) is one such derivation.

    Now suppose \( K \neq \mathbb C(t) \).
    Write \( K_0 = \mathbb C(t) \), so \( K = \mathbb C(t,\alpha) = K_0(\alpha) \) for \( \alpha \in K \setminus K_0 \) algebraic over \( K_0 \).
    Let \( h(t) \in K_0[X] \) be the minimal polynomial of \( \alpha \).
    By minimality of \( h \), \( h'(\alpha) \neq 0 \) as it does not have a double root.
    By the previous lemma, \( \dd{t}, \dd{\alpha} \) span \( \Omega_K \) as a \( K \)-vector space.

    If \( f \in K_0[X] \), write \( D_t f \) for \( \pdv{f}{t} \), by \( t \)-differentiating the coefficients.
    The lemma gives \( 0 = \dd{(h(\alpha))} = D_t h(\alpha) \dd{t} + h'(\alpha) \dd{\alpha} \).
    Hence \( \Omega_K \) is spanned by \( \dd{t} \), so it suffices to show \( \Omega_K \) is nonzero.
    As in the first part, it suffices to exhibit a single nonzero derivation on \( K \).

    First, define \( D \colon K_0[X] \to K \) by \( D(f) = D_t f \) if \( f \in K_0 \), \( D(X) = \frac{-(D_t h)(\alpha)}{h'(\alpha)} \), and \( D(X^n) = n\alpha^{n-1} D(X) \).
    One can check that the ideal \( hK_0[X] \) is mapped to zero under \( D \).
    This exhibits a nonzero derivation as required.
\end{proof}

\subsection{Rational differentials}
\begin{definition}
    Denote \( \Omega_V = \Omega_{\mathbb C(V)/\mathbb C} \).
    Elements of \( \Omega_V \) are called \emph{rational differentials}.
    A differential \( \omega \in \Omega_V \) is \emph{regular} at a point \( P \in V \) if \( \omega \) can be expressed as \( \sum_i f_i \dd{g_i} \) where \( f_i, g_i \in \mathcal O_{V,P} \).
    Write
    \[ \Omega_{V,P} = \qty{\omega \in \Omega_V \mid \omega \text{ regular at } P} \subseteq \Omega_V \]
\end{definition}
Note that \( \Omega_{V,P} \) is not a vector subspace over \( \mathbb C(V) \), since we can multiply by functions that are not regular.
However, it is a module over \( \mathcal O_{V,P} \).

Recall that \( \mathcal O_{V,P} \) contains the maximal ideal \( \mathfrak m_P \), which is principal, giving local coordinates.
We can make a similar construction in the context of differentials.
\begin{theorem}
    \( \Omega_{V,P} \) is a free \( \mathcal O_{V,P} \)-module generated by \( \dd{\pi_P} \) where \( \pi_P \) is a local coordinate at \( P \).
    In other words, \( \Omega_{V,P} = \qty{f\dd{\pi_P} \mid f \in \mathcal O_{V,P}} \).
\end{theorem}
\begin{remark}
    If \( \pi, \pi' \) are local coordinates at \( P \), \( \dd{\pi} = u \dd{\pi'} \) where \( u \in \mathcal O_{V,P}^\star \).
    More generally, if \( \omega \in \Omega_V \), then \( \pi^j \omega \) is regular, so lies in \( \Omega_{V,P} \), for sufficiently large \( k \).
    Given this theorem, we can always write \( \omega \in \Omega_V \) as \( f \dd{\pi_P} \) where \( \pi_P \) is a local coordinate at \( P \) and \( f \in \mathbb C(V) \).
\end{remark}
\begin{definition}
    Let \( \omega \in \Omega_V \) and \( P \in V \).
    Define \( \nu_P(\omega) = \nu_P(f) \) where \( \omega = f \dd{\pi_P} \) and \( \pi_P \) is a local coordinate at \( P \).
\end{definition}
\begin{lemma}
    Let \( \omega \in \Omega_V \) be a nonzero differential.
    Then, \( \nu_P(\omega) \neq 0 \) for only finitely many points \( P \).
\end{lemma}
\begin{proof}
    As \( \nu_P(f \dd{g}) = \nu_P(f) + \nu_P(\dd{g}) \) and \( \nu_P(f) = 0 \) for all but finitely many points, it suffices to only prove this lemma for the case \( \omega = \dd{g} \).
    Moreover, as \( g \) must be non-constant as \( \dd{g} \neq 0 \), we can assume that \( g \) is transcendental.
    hence, \( \faktor{\mathbb C(V)}{\mathbb C(g)} \) is a finite extension.
    Consider \( (1 : g) \colon V \to \mathbb P^1 \).
    By the finiteness theorem for rational functions, there are only finitely many \( P \in V \) such that \( g(P) = \infty \) or \( e_P > 1 \).

    If \( P \) is a point where \( e_P = 1 \), so the function is unramified, \( \varphi^\star (t - g(P)) \) is a local coordinate at \( P \).
    But \( \varphi^\star(t-g(P)) \) is \( g - g(P) \), so \( \nu_P(\dd{g}) = 0 \).
\end{proof}
Differentials provide another source of divisors.
\begin{definition}
    Let \( \omega \in \Omega_V \).
    Then \( \operatorname{div} \omega = \sum_{P \in V} \nu_P(\omega) [P] \).
\end{definition}
\begin{proposition}
    Let \( \omega, \omega' \) be nonzero rational differentials on \( V \).
    Then, \( \operatorname{div}\omega - \operatorname{div}\omega' \) is principal.
\end{proposition}
\begin{proof}
    Since \( \Omega_V \) is one-dimensional over \( \mathbb C(V) \), we can write \( \omega = f \omega' \) where \( f \in \mathbb C(V) \).
    It follows from the definitions that \( \operatorname{div}\omega - \operatorname{div}\omega' = \operatorname{div}f \).
\end{proof}
If \( \omega \) is a nonzero differential, \( \operatorname{div} \omega \) gives a well-defined element in \( \mathrm{Pic}(V) = \mathrm{Cl}(V) = \faktor{\mathrm{Div}(V)}{\mathrm{Prin}(V)} \).
We say that \( \operatorname{div}\omega \) is a \emph{canonical divisor}, and its equivalence class is the \emph{canonical class}, denoted \( K_V \).
Sometimes \( K_V \) is also simply called the canonical divisor.

We now prove the above theorem.
\begin{proof}
    We want to check that \( \dd{\pi_P} \) generates the module \( \Omega_{V,P} \) over \( \mathcal O_{V,P} \).
    Clearly \( \mathcal O_{V,P} \dd{\pi_P} \subseteq \Omega_{V,P} \); we want to check that the converse holds.
    Given \( f \in \mathcal O_{V,P} \), \( f - f(P) \in \mathfrak m_P \).
    Hence, \( f = f(P) + \pi_P g \in \mathcal O_{V,P} \) where \( g \in \mathcal O_{V,P} \).
    By the Leibniz rule, \( \dd{f} = g \dd{\pi_P} + \pi_P \dd{g}  \in \mathcal O_{V,P} \dd{\pi_P} + \pi_P \Omega_{V,P} \).
    Assume that \( \Omega_{V,P} \) is finitely generated.
    Observe that
    \[ \mathcal O_P \dd{\pi_P} \subseteq \Omega_{V,P} \subseteq \mathcal O_P \dd{\pi_P} + \pi_P \Omega_{V,P} \]
    Apply Nakayama's lemma to \( R = \mathcal O_{V,P}, J = \mathfrak m_P, M = \Omega_{V,P}, N = \mathcal O_{V,P} \dd{\pi_P} \).

    To show \( \Omega_{V,P} \) is finitely generated, choose an affine patch \( V_0 \subseteq V \) containing \( P \).
    Then \( C[V_0] = \mathbb C[x_1, \dots, x_n] \) where the \( x_i \) generate \( \mathbb C[V_0] \).
    If \( f \in \mathcal O_{V,P} \), we can write \( f = \frac{g}{h} \) where \( g, h \) are polynomials and \( h(P) \neq 0 \).
    Thus
    \[ \dd{f} = \sum_{i=1}^n \qty(\frac{h\pdv{g}{X_i} - g\pdv{h}{X_i}}{h^2})(x_1, \dots, x_n) \dd{x_i} \]
    But \( h(P) \neq 0 \), so \( \dd{f} \) is in the \( \mathcal O_{V,P} \)-span of \( \qty{\dd{x_i}} \).
\end{proof}
\begin{example}
    Let \( V = \mathbb P^1 \), and let \( t \) be the coordinate on the standard \( \mathbb A^1 \subseteq \mathbb P^1 \).
    For any \( a \in \mathbb C \), the rational function \( (t - a) \) is a local coordinate.
    At infinity, \( \frac{1}{t} \) is a local coordinate.

    We now calculate \( \operatorname{div} \dd{t} \).
    We have \( \nu_a(\dd{t}) = \nu_a(\dd{(t-a)}) = 0 \) for all \( a \in \mathbb C \).
    Note that \( \dd{t} = -t^2 \dd{\qty(\frac{1}{t})} \) so
    \[ \nu_\infty(\dd{t}) = \nu_\infty\qty(\frac{-1}{\qty(\frac{1}{t})^2} \dd{\qty(\frac{1}{t})}) = -2 \]
    Hence \( \operatorname{div} \dd{t} = -2[\infty] \), so the degree is nonzero, hence this divisor is not principal.
\end{example}
\begin{definition}
    Let \( V \) be a curve.
    The \emph{genus} of \( V \) is \( g(V) = \ell(K_V) \).
\end{definition}
\( L(K_V) \) is not well-defined, but \( \ell(K_V) \) is.
Note that if \( V = \mathbb P^1 \), then \( \operatorname{div}\dd{t} = -2[\infty] \), so \( \ell(K_{\mathbb P^1}) = 0 \), as there are no rational functions on \( \mathbb P^1 \) that vanish to order 2 at infinity, apart from the zero function.

\subsection{Differentials on plane curves}
We will study curves in \( \mathbb P^2 \).
\begin{example}[smooth plane cubics]
    Consider \( V = \mathbb V(F) \subseteq \mathbb P^2 \) where \( F = X_0 X_2^2 - \prod_{i=1}^3 (X_1 - \lambda_i X_0) \) with \( \lambda_1, \lambda_2, \lambda_3 \) distinct complex numbers.
    This curve is nonsingular.
    To calculate the genus, we take the following steps.
    \begin{enumerate}
        \item We first use the affine equation \( f(x,y) = y^2 - \prod_{i=1}^3 (x - \lambda_i) \), and write \( f(x,y) = y^2 - g(x,y) \).
        Differentiating, \( 2y \dd{y} = g'(x) \dd{x} \) is a nontrivial relation in \( \Omega_V \).
        \item Using this relation, we choose a convenient differential \( \omega \in \Omega_V \); in this case, we will choose \( \omega = \frac{\dd{x}}{y} \).
        \item Calculate \( \operatorname{div}\omega \) by using the fact that if \( \pdv{f}{y}\qty(P) \) is nonzero, \( x - x(P) \) is a local parameter, and if \( \pdv{f}{x}\qty(P) \) is nonzero, \( y - y(P) \) is a local parameter.
    \end{enumerate}
    % see notes for example for the actual calculation
    We find that \( K_V = 0 \).
    Hence, \( g(V) = 1 \) as \( \ell(0) = 1 \).
\end{example}
\begin{theorem}
    Let \( V \) be a smooth plane cubic.
    Then \( g(V) = 1 \), and in particular, \( V \not\simeq \mathbb P^1 \).
\end{theorem}
\begin{proof}
    Change coordinates into the example above.
\end{proof}
\begin{theorem}
    Let \( V = \mathbb V(F) \subseteq \mathbb P^2 \) be a smooth projective plane curve of degree \( d \).
    Then \( K_V = (d - 3)H \) where \( H \) is the divisor class associated to a hyperplane section of \( V \).
\end{theorem}
\begin{proof}
    First, we will select a differential \( \omega \in \Omega_V \).
    Change coordinates such that \( (0 : 1 : 0) \not\in V \).
    Let \( x = \frac{X_1}{X_0}, y = \frac{X_2}{X_0} \) be elements of \( \mathbb C(V) \).
    Set \( f(X,Y) = F(1,X,Y) \), so \( f(x,y) = 0 \) in \( \mathbb C(V) \).
    Differentiating, \( \pdv{f}{X}\qty(x,y) \dd{x} + \pdv{f}{Y}\qty(x,y) \dd{y} = 0 \) is a relation in \( \Omega_V \).
    Choose
    \[ \omega = \frac{\dd{x}}{\pdv{f}{Y}\qty(x,y)} = \frac{-\dd{y}}{\pdv{f}{X}\qty(x,y)} \]
    Then, we will calculate \( \operatorname{div}\dd{\omega} \) in this affine patch.
    If \( \pdv{f}{Y}\qty(P) \neq 0 \), then \( x - x(P) \) is a local coordinate at \( P \).
    Then, \( \nu_P(\omega) = \nu_P\qty(\frac{1}{\pdv{f}{Y}}\qty(x,y)) = 0 \).
    Otherwise, \( \pdv{f}{X}\qty(P) \neq 0 \) by smoothness, so \( y - y(P) \) is a local coordinate and \( \nu_P(\omega) = 0 \).

    Since \( (0 : 1 : 0) \not\in V \), any point at infinity in \( V \) is not contained in \( \qty{X_2 = 0} \).
    The equation for \( V \) on the patch \( \qty{X_2 \neq 0} \) is \( g(z,w) = 0 \) where \( z = \frac{X_0}{X_2} = \frac{1}{y} \) and \( y = \frac{X_1}{X_2} = \frac{x}{y} \) and \( g(Z,W) = F(Z,W,1) \) in \( \mathbb C[Z,W] \).
    Select a different differential
    \[ \eta = \frac{\dd{z}}{\pdv{g}{W}\qty(z,w)} = \frac{-\dd{w}}{\qty{g}{Z}\qty(z,w)} \]
    By the same argument as before, \( \nu_P(\eta) = 0 \) for all \( P \) in the patch \( \qty{X_2 \neq 0} \).
    Using \( f(X,Y) = Y^d g\qty(\frac{1}{X}, \frac{X}{Y}) \) and differentiating, we find \( \omega = Z^{d-3} \eta \).
    If \( X_2(P) \neq 0 \), we calculate \( \nu_P(\omega) = (d-3)\nu_P(z) + \nu_P(\eta) = (d-3)\nu_P(z) \).
    As \( Z = \frac{X_0}{X_2} \), \( \operatorname{div} \omega = (d-3) \operatorname{div} X_0 \) as claimed.
\end{proof}
\begin{proposition}
    If \( f(x,y) = 0 \) is an affine patch equation for a smooth projective plane curve, and \( \deg f \geq 3 \), then
    \[ \qty{\frac{x^r y^s \dd{x}}{\pdv{f}{y}} \midd 0 \leq r, s;\; r + s \leq d - 3} \]
    is a basis for \( L(K_V) \) for the representative of \( K_V \) given by \( (d-3)H \) where \( H \) is the hyperplane at infinity.
\end{proposition}
The \( \dd{x} \) term can be considered a dummy symbol, meant to indicate that we think of the term as a differential.
\begin{proof}
    The proof is non-examinable, and follows from the same argument as the proof of the previous theorem.
\end{proof}
\begin{corollary}
    If \( d, d' \geq 2 \) are distinct integers, then smooth plane curves of degrees \( d, d' \) are never isomorphic.
\end{corollary}
\begin{proof}
    \( \deg K_V \) depends only on \( V \) up to isomorphism.
\end{proof}
In particular, there are infinitely many distinct curves up to isomorphism.

\subsection{The Riemann--Roch theorem}
\begin{theorem}
    Let \( V \) be a smooth irreducible projective curve of genus \( g \), and let \( D \) be a divisor on \( V \).
    Let \( K_V \) be the canonical divisor class.
    Then,
    \[ \ell(D) - \ell(K_V - D) = \deg(D) - g + 1 \]
\end{theorem}
The proof is beyond the scope of this course.
This theorem is related to Stokes' theorem and the Gauss--Bonnet theorem.
\begin{corollary}
    Let \( K \) be the canonical divisor on \( V \).
    Then, \( \deg(K) = 2g - 2 \).
\end{corollary}
Note that \( 2g - 2 = -\chi(V) \), the negative of the Euler characteristic of \( V \).
\begin{proof}
    Let \( D = K \) in the Riemann--Roch theorem, and use \( \ell(0) = 1 \).
\end{proof}
\begin{corollary}
    Let \( V \) be a smooth projective plane curve of degree \( d \).
    Then the genus is \( g(V) = \frac{(d-1)(d-2)}{2} \).
\end{corollary}
\begin{proof}
    We have seen that if \( d = 1, 2 \) then \( V \simeq \mathbb P^1 \).
    If \( d \geq 3 \), we have seen that \( K \) is linearly equivalent to \( (d-3)H \) where \( H \) is a hyperplane section.
    But \( \deg(H) = d \), hence the result follows from the Riemann--Roch theorem.
\end{proof}
Given a divisor \( D \) on \( V \), calculating \( \ell(D) \) is hard with the techniques discussed so far.
However, the Riemann--Roch theorem can be used to compute this for most \( D \).
\begin{corollary}
    If \( \deg(D) > 2g - 2 \), then \( \ell(D) = \deg(D) - g + 1 \).
\end{corollary}
\begin{proof}
    The divisor \( K - D \) has negative degree, hence \( \ell(K-D) = 0 \).
\end{proof}
We can compare this to the case \( V = \mathbb P^1 \), where we saw by direct calculation that \( \ell(D) = \deg(D) + 1 \).
\begin{corollary}
    Suppose \( g(V) = 1 \).
    Then if \( D \) is a divisor with \( \deg(D) > 0 \), then \( \ell(D) = \deg(D) \).
\end{corollary}
\begin{proof}
    \( \ell(K-D) = \ell(-D) = 0 \).
\end{proof}
Let \( V \) be a curve of genus 1, and fix \( P_0 \in V \).
Let \( P, Q \in V \), then \( P + Q - P_0 \) is equivalent to a unique effective divisor of degree 1.
So \( P + Q - P_0 \) is equivalent to \( R \) for a unique \( R \in V \).
Indeed, \( \deg(P+Q-P_0) = 1 \) hence \( \ell(P+Q-P_0) = 1 \), so there exists a function \( f \in \mathbb C(V) \) such that \( (P+Q-P_0) + \operatorname{div}(f) \) is effective, and hence equal to a point \( R \).
It is unique as \( \ell(P+Q-P_0) = 1 \), and scalar multiples of \( f \) give the same divisor.

In other words, given \( E = (V, P_0) \) as above, we can define \( P +_E Q = R \) using the preceding notation.
The pair \( (V,P_0) \) where \( g(V) = 1, P_0 \in V \) is called an \emph{elliptic curve}.
Topologically, such \( V \) in the Euclidean topology are homeomorphic to \( \mathbb S^1 \times \mathbb S^1 \); the group law defined by \( +_E \) and that defined on \( \mathbb S^1 \times \mathbb S^1 \) in fact coincide.
\begin{theorem}
    The operation \( +_E \) gives \( E \) the structure of an abelian group with identity \( P_0 \).
    Moreover, the map \( E \to \mathrm{Cl}^0(E) = \mathrm{Cl}^0(V) \) defined by \( P \mapsto [P - P_0] \) is an isomorphism of groups.
\end{theorem}
\begin{proof}
    Let \( \beta(P) = [P - P_0] \in \mathrm{Cl}^0(E) = \faktor{\mathrm{Div}^0(E)}{\mathrm{Prin}(E)} \).
    First, we show injectivity.
    Suppose \( \beta(P) = \beta(Q) \), so \( P - P_0 \sim Q - P_0 \), where \( \sim \) denotes linear equivalence.
    Hence \( P \sim Q \).
    However, \( \ell(P) = 1 \) by the Riemann--Roch theorem, so \( P = Q \).

    Now, we show surjectivity.
    Suppose \( D \) has degree 0.
    We want to show \( D \) is equivalent to \( [P - P_0] \) for some \( P \).
    Since the degree of \( D + P_0 \) is 1, \( \ell(D + P_0) = 1 \) by Riemann--Roch.
    Hence there exists \( P \in V \) such that \( D + P_0 \sim P \).
    So \( D = \beta(P) \) as required.

    Hence \( \beta \) is a bijection of sets, so it remains to check that \( \beta \) is a homomorphism; this is straightforward.
\end{proof}
\begin{theorem}
    Let \( E = (V, P_0) \) be the elliptic curve given by \( \mathbb V(F) \) where \( F = X_0 X_2^2 - \prod_{i=1}^3 (X_1 - \lambda_i X_0) \).
    Choose \( P_0 = (0 : 0 : 1) \).
    Then, \( P +_E Q +_E R = 0_E \) if and only if \( P, Q, R \) are collinear in \( \mathbb P^2 \).
\end{theorem}
The proof is nonexaminable.
% TODO: Check wording of thm from notes

Given a morphism \( \varphi \colon V \to W \) of curves, we wish to understand the relation between \( g(V) \) and \( g(W) \).
Let \( \omega = f \dd{t} \in \Omega_W \), where \( \mathbb C(W) / \mathbb C(t) \) is finite.
Since \( \mathbb C(V)/\mathbb C(t) \) is finite, \( \Omega_V \) is generated by \( \dd{\varphi^\star t} \).
Define the pullback \( \Omega_W \to \Omega_V \) by \( \varphi^\star \omega = \varphi^\star f \dd{\varphi^\star t} \).
Let \( P \) be a point on \( V \), and \( Q = \varphi(P) \).
We compare \( \nu_P(\varphi^\star \omega) \) and \( \nu_Q(\omega) \).
\begin{lemma}
    Let \( \pi_P, \pi_Q \) be local parameters at \( P, Q \).
    Let \( e_P \) be the ramification degree at \( P \), so \( \varphi^\star(\pi_Q) = u \pi_P^{e_P} \) where \( u \) is a unit in \( \mathcal O_{V,P} \).
    Then, \( \nu_P(\varphi^\star(\dd{\pi_Q})) = e_P - 1 \).
    More generally, \( \nu_P(\varphi^\star \omega) = e_P \nu_Q(\omega) + e_P - 1 \).
\end{lemma}
This can be thought of as a generalisation of the rule \( \dv{x}\qty{x^n} = nx^{n-1} \).
\begin{proof}
    For the first part, we have that \( \varphi^\star(\pi_Q) = u \pi_P^{e_P} \), so differentiating and taking valuation gives the desired result.
    For a general \( \omega \), we can write \( \omega = u \pi_Q^m \dd{\pi_Q} \) where \( u \) is a unit in \( \mathcal O_{V,P} \) as \( \Omega_{W,Q} \) is a free module generated by \( \dd{\pi_Q} \).
    Then, we can apply \( \varphi^\star \) and proceed as in the first part.
\end{proof}
\begin{theorem}[Riemann--Hurwitz]
    Let \( \varphi \colon V \to W \) be as above.
    Let \( n = \deg \varphi \), \( n \neq 0 \).
    Then
    \[ 2g(V) - 2 = n(2g(W) - 2) + \sum_{P \in V} (e_P - 1) \]
    where \( e_P \) is the ramification of \( \varphi \) at \( P \).
\end{theorem}
Note that the correction term \( \sum_{P \in V} (e_P - 1) \) is nonnegative.
\begin{proof}
    Let \( \omega \in \Omega_W \) be nonzero.
    Then, by the Riemann--Roch theorem, and the previous lemma,
    \begin{align*}
        2g(V) - 2 &= \deg(\operatorname{div}(\varphi^\star \omega)) \\
        &= \sum_{P \in V} \nu_P(\varphi^\star \omega) \\
        &= \sum_{Q \in W} \sum_{P \in \varphi^{-1}(Q)} \nu_P(\varphi^\star \omega) \\
        &= \sum_{Q \in W} \sum_{P \in \varphi^{-1}(Q)} (e_P \nu_Q(\omega) + e_P - 1) \\
        &= \sum_{Q \in W} \qty(n\nu_Q(\omega) + \sum_{P \in \varphi^{-1}(Q)}(e_P - 1)) \\
        &= n \deg(\operatorname{div}(\omega)) + \sum_{P \in V} (e_P - 1) \\
        &= n (2g(W) - 2) + \sum_{P \in V} (e_P - 1)
    \end{align*}
\end{proof}
\begin{corollary}
    Let \( V, W \) be curves with \( g(V) < g(W) \).
    Then any rational map \( V \dashrightarrow W \) is constant.
\end{corollary}
\begin{proof}
    Any rational map of this form is a morphism, then apply the Riemann--Hurwitz theorem.
\end{proof}
For example, there is no map \( \mathbb P^1 \to V \) for \( g(V) \geq 1 \).

\subsection{Equations for curves using Riemann--Roch}
Let \( V \subseteq \mathbb P^n \) be a curve not contained in any hyperplane; this can be done without loss of generality by iteratively reducing \( n \).
Let \( D = \operatorname{div}(X_0) \) be the hyperplane section.
Let \( G \in \mathbb C[\vb X] \) be a homogeneous linear polynomial.
Then \( f = \frac{G}{X_0} \in \mathbb C(V)^\star \).
Observe that \( \operatorname{div} f + D = \operatorname{div} G \) is effective.
Hence \( f \in L(D) \).

We thus obtain an injective linear map from the space of linear homogeneous polynomials in \( \mathbb C[\vb X] \) into \( L(D) \) defined by \( G \mapsto \frac{G}{X_0} \).
This is injective because \( V \) is not contained inside a hyperplane.
We make the following observations.
\begin{enumerate}
    \item For any point \( P \in V \), there exist linear homogeneous polynomials \( F, G \) such that \( F(P) \neq 0 \) and \( G(P) = 0 \).
    \item If \( P \) is a smooth point and \( L \) is the tangent line in \( \mathbb P^n \), we can find a linear homogeneous polynomial \( F \) such that \( F(P) = 0 \) but \( F \) does not vanish on all of \( L \).
\end{enumerate}
Under this injection, we obtain the following condition.
We say that a divisor \( D \) on \( V \) satisfies condition (\( \star \)) if for every \( P, Q \in V \) not necessarily distinct, we have \( \ell(D - P - Q) = \ell(D) - 2 \).
\begin{definition}
    Let \( V \) be a curve, and let \( D \) a divisor with \( \ell(D) = n + 1 \geq 2 \).
    Let \( \qty{f_0, \dots, f_n} \) be a basis for \( L(D) \).
    The \emph{morphism associated to \( D \)} is \( \varphi_D \colon V \to \mathbb P^n \) given by \( (f_0 : \dots : f_n) \).
\end{definition}
We say that \( \varphi_D \) is an \emph{embedding} if it is an isomorphism onto its image.
\begin{theorem}
    The morphism \( \varphi_D \) associated to \( D \) is an embedding if and only if \( D \) satisfies condition (\( \star \)).
\end{theorem}
The proof is omitted.
\begin{corollary}
    Suppose \( D \) is a divisor with \( \deg D > 2g \).
    Then \( \varphi_D \) is an embedding.
\end{corollary}
\begin{proof}
    By Riemann--Roch, \( D \) satisfies (\( \star \)).
\end{proof}
\begin{corollary}
    Every curve of genus \( g \) can be embedded in \( \mathbb P^m \) for some \( m \) depending only on \( g \).
\end{corollary}
\begin{proof}
    If \( g \geq 3 \), take \( [D] = 2K_V \).
    If \( g = 2 \), take \( [D] = 3K_V \).
    If \( g = 1 \), take \( [D] = 3[P_0] \) for some \( P_0 \in V \).
    In any case, \( \deg D > 2g \).
\end{proof}
\begin{definition}
    A curve \( V \) of genus \( g(V) \geq 2 \) is called \emph{hyperelliptic} if there exists a degree 2 morphism \( V \to \mathbb P^1 \).
\end{definition}
The following theorem is on the last example sheet.
\begin{theorem}
    A curve of genus \( g \) is hyperelliptic if and only if there exists a divisor \( D \) such that \( \deg D = 2 \) and \( \ell(D) = 2 \).
\end{theorem}
\begin{theorem}
    Let \( V \) be a curve of genus \( g(V) \geq 2 \) that is not hyperelliptic.
    Then, the morphism \( \varphi_{K_V} \colon V \to \mathbb P^{g-1} \) is an embedding.
\end{theorem}
\begin{proof}
    Suppose that \( \varphi_K \) is not an embedding.
    Then \( K \) violates (\( \star \)), so there exist points \( P, Q \in V \) such that \( \ell(K - P - Q) \geq g - 1 \).
    Then by Riemann--Roch, \( D = P + Q \) has \( \ell(D) \geq 2 \).
    But this is the maximal value by the above inequalities, so the result follows.
\end{proof}
% Skipped Thm 19.4 in notes, nonexaminable.
